// 公共接口
import { filePost, request } from "@/utils/http.js";

import globalConfig from "@/utils/config.js";

const baseUrl = globalConfig.microUrl;
const modules = `${baseUrl}/ri`;

export default {
  // 查询单项购买权益列表
  listSingleItem: (data) => {
    return request({
      url: `${modules}/rights/listSingleItem`,
      method: "GET",
      data
    });
  },
  singleItemSku: (data) => {
    return request({
      url: `${modules}/rights/listSku`,
      method: "GET",
      data
    });
  },
  // 套餐列表
  setmealList: (data) => {
    return request({
      url: `${modules}/rightsPackage/list`,
      method: "GET",
      data
    });
  },
  // 套餐详情
  listIncludeDetail: (data) => {
    return request({
      url: `${modules}/rightsPackage/listIncludeDetail`,
      method: "GET",
      data
    });
  },
  // 立即开通
  submitRightsOrder: (data) => {
    return request({
      url: `${modules}/rightsOrder/submitRightsOrder`,
      method: "POST",
      data
    });
  },

  // 有料宝收银台-提交订单
  submitPayOrder: (data) => {
    return request({
      url: `${modules}/rightsPay/submitPayOrder`,
      method: "POST",
      data
    });
  },
  // 有料宝收银台-获取订单信息
  getOderInfo: (data) => {
    return request({
      url: `${modules}/rightsOrder/getOderInfo`,
      method: "POST",
      data
    });
  },

  rightsUploadPayFile: (data) => {
    return filePost({ url: `${modules}/rightsPay/uploadImg`, filePath: data });
  }
};
